using SignalR.Server.Models;
using System.Diagnostics;

namespace NUnit
{
    public class Tests : BaseTest
    {
        public SignalrRedisHelper _redis => new SignalrRedisHelper(Microsoft.Extensions.Options.Options.Create<AppSetting>(GetAppSetting()));

        [SetUp]
        public void Setup()
        {
         
         }

        [Test]
        public async Task TestAddConnectForUserAsync()
        {
            Stopwatch sw = new Stopwatch();
            sw.Start();
            for (int i = 0; i < 1000; i++)
            {
                await _redis.AddConnectForUserAsync($"test:{i}", $"connection1{i}");
                await _redis.AddConnectForUserAsync($"test:{i}", $"connection2{i}");
            }
            sw.Stop();
            Console.WriteLine(sw.ElapsedMilliseconds);
        }
    }
}